package consts

const (
	SUCCESS         = 0   // status 状态
	STATUS_VALID    = 10  // 账号有效或者已启用
	STATUS_INVALID  = -10 // 临时
	STATUS_INACTIVE = -10 // 账号未启用
	STATUS_DELETED  = -20 // 账号删除
	STATUS_BLOCKED  = -30 // 账号冻结

	ERROR_CODE__PARAM__ILLEGAL = 1101

	WECHAT_MESSAGE_NOT_EXIST = 3021

	// etcd相关操作错误码
	ETCD_CREATE_DIR_ERROR = 3001
	ETCD_CREATE_KEY_ERROR = 3002
	ETCD_READ_KEY_ERROR   = 3003

	// http
	ERROR_CODE__SOURCE_DATA__ILLEGAL      = 1101 // 外部传入参数错误
	ERROR_CODE__GRPC__FAILED              = 1102 // grpc 调用失败
	ERROR_CODE__HTTP__CALL_FAILD_EXTERNAL = 1103 // http外部调用失败
	ERROR_CODE__HTTP__CALL_FAILD_INTERNAL = 1104 // http内部调用失败
	ERROR_CODE__JSON__PARSE_FAILED        = 1105 // JSON解析失败
	ERROR_CODE__HTTP__INPUT_EMPTY         = 1106

	// database
	ERROR_CODE__DB__INSERT                      = 1001
	ERROR_CODE__DB__READ                        = 1002
	ERROR_CODE__DB__UPDATE                      = 1003
	ERROR_CODE__DB__NO_ROW                      = 1007
	ERROR_CODE__DB__UNEXPECTED                  = 1008
	ERROR_CODE__DB__TRANSACTION_BEGIN_FAILED    = 1009
	ERROR_CODE__DB__TRANSACTION_COMMIT_FAILED   = 1010
	ERROR_CODE__DB__UPDATE_UNEXPECTED           = 1011
	ERROR_CODE__DB__TRANSACTION_ROLLBACK_FAILED = 1010

	// session
	ERROR_CODE__SESSION__START_FAILED  = 1404
	ERROR_CODE__SESSION__EMPTY_SESSION = 1410
	ERROR_CODE__SESSION__SET_FAILED    = 1411

	// session 相关错误码
	SESSION_ERROR_NO_USER_ID         = 1401
	SESSION_ERROR_NO_COMPANY_ID      = 1402
	SESSION_ERROR_EMPTY_INPUT        = 1403
	SESSION_ERROR_START_FAIL         = 1404
	SESSION_ERROR_NO_USER_NAME       = 1405
	SESSION_ERROR_NO_COMPANY_NAME    = 1406
	SESSION_ERROR_EMPTY_SESSION      = 1407
	SESSION_ERROR_INVALID_USER_ID    = 1408
	SESSION_ERROR_INVALID_COMPANY_ID = 1409
	SESSION_ERROR_NO_SESSION         = 1410

	// header 相关错误码
	ERROR_CODE__HEADER__NO_USER_ID               = 1501
	ERROR_CODE__HEADER__NO_COMPANY_ID            = 1502
	ERROR_CODE__HEADER__NO_USER_NAME             = 1504
	ERROR_CODE__HEADER__NO_COMPANY_NAME          = 1505
	ERROR_CODE__HEADER__NO_POSITIONS             = 1506
	ERROR_CODE__HEADER__POSITIONS_FORMAT_ILLEGAL = 1507
	ERROR_CODE__HEADER__NO_USER_MOBILE           = 1509
	ERROR_CODE__HEADER__NO_USER_CODE             = 1510

	// IO文件解析错误码
	FILE_OPEN_FAILED = 4001
	FILE_READ_FAILED = 4002
)
